#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N = 600851475143LL;
const ll max_sieve_size = 100000000;
vector<ll> primes, factors;
bitset<max_sieve_size+10> bs;
void sieve(ll ub) {
  ll sieve_size = ub+1;
  bs.set();
  bs[0]=bs[1]=0;
  for(ll i=0;i<=sieve_size; ++i)
    if(bs[i]) {
      for(ll j=i*i; j<=sieve_size; j+=i)
        bs[j]=0;
      primes.push_back(i);
    }

}
void prime_factorize() { // O(\pi (\sqrt{N})) = O(\sqrt(N) / \ln(\sqrt(N)))
  ll N = ::N;
  factors.clear();
  ll pf_idx = 0, pf = primes[pf_idx];
  while(pf*pf<=N) {
    while(N%pf==0) {N/=pf; factors.push_back(pf);}
    pf = primes[++pf_idx];
  }
  if(N!=1)factors.push_back(N);
}
int main() {
  sieve(max_sieve_size);
  prime_factorize();
  for(auto el:factors) cout<<el<<endl;
}
